package ch.jhc.sevlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@WebServlet("/upload.php")

public class RegisterSevlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	public RegisterSevlet() {
        super();
    }
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.getWriter().append("Served at: ").append(request.getContextPath());
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		request.setCharacterEncoding("UTF8");
		String uname = request.getParameter("username");
		String pwd = request.getParameter("pwd");
		String sex = request.getParameter("sex");
		String filename = request.getParameter("file");
		String[] interest = request.getParameterValues("interest");
		System.out.println(uname);
		System.out.println(pwd);
		System.out.println(sex);
		System.out.println(filename);
		for(String string : interest) {
			System.out.println(string);
		}
	}
}
